package distinctStream;

import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;

public class DistincrtStrream {
    public static void main(String[] args) {
        //distint主要是去除掉集合中重复的代码
        List<Integer> list = Arrays.asList(1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6);
        List<Integer> collect = list.stream().distinct().collect(Collectors.toList());
        collect.forEach(System.out::println);
    }
}
